package nl.boektrust.btsoep.client;

import java.util.List;

import nl.boektrust.btsoep.shared.model.ImageReferenceTypeCode;
import nl.boektrust.btsoep.shared.model.Person;
import nl.boektrust.btsoep.shared.model.PhysicalBookManifestation;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.googlecode.objectify.Key;

//The RemoteServiceRelativePath annotation must match the servlet URL configured in
//web.xml
@RemoteServiceRelativePath("persistentservice")
public interface PersistentService extends RemoteService {
    
    void persistBTEntity(String name, String url) throws IllegalArgumentException;
    Key<Person> persistPerson(Person person) throws IllegalArgumentException;
    void deletePerson(Person person) throws IllegalArgumentException;
    List<Person> getAllPersons() throws IllegalArgumentException;
    void persistPhysicalBookManifestation(PhysicalBookManifestation bookmf) throws IllegalArgumentException;
    List<PhysicalBookManifestation> getAllPhysicalBookManifestations() throws IllegalArgumentException;
    void deletePhysicalBookManifestation(PhysicalBookManifestation book) throws IllegalArgumentException;
    int getNumberOfAssets(ImageReferenceTypeCode imageReferenceType) throws IllegalArgumentException;
    List<PhysicalBookManifestation> getBooksByISBN(String isbn) throws IllegalArgumentException;
    int getNumberOfEntities() throws IllegalArgumentException;
    int getNumberOfPhysicalBooks() throws IllegalArgumentException;
    List<PhysicalBookManifestation> getBooksForPerson(Person p) throws IllegalArgumentException;
    List<Person> getPersonsByPartialName(String name)  throws IllegalArgumentException;
    String getUploadURL(String path)  throws IllegalArgumentException;
}
